// Learn TypeScript:
//  - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/typescript.html
//  - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html
//  - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html
//  - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html

const {ccclass, property} = cc._decorator;
import cMountMgr from "../SuperMgr/cMountMgr";
import cGameModule from "./bJYMTGameTabModule"
import cEnumMds from "../Enum/cEnumMds"
@ccclass
export default class jymtLoadingMount extends cMountMgr {
    @property(cc.ProgressBar)
    bar:cc.ProgressBar = null;
    private finsh:boolean = false;
    
    update(dt){
        if(!this.finsh){
            this.bar.progress = Math.min(1,this.bar.progress+(dt/2));;
            if(1 == this.bar.progress){
                let mod:cGameModule = this.getModule(cEnumMds.jymtGameTabMoudle)
                if(!mod){
                    mod = new cGameModule()
                }
                this.finsh = true;
                mod.changeStart();
            }
        }
    }
}
